﻿namespace Web.Control.Member.Teach
{
    using System;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using System.Text.RegularExpressions;
    using Lx.Web.Common.UI;
    using Lx.Web.Common.ControlsUI;
    using System.Collections;

    using BLF.WWW_User.Teach;
    using Model.WWW_User.Teach;

    public class Tpstep4 : BaseControl
    {
        protected string os = "";
        protected override void OnLoad(EventArgs e)
        {
            if (HttpContext.Current.User.Identity.Name == "")
            {
                Page.Response.Redirect(LoginHost + "/User/login.htm?ReturnUrl=" + Page.Request.Url.AbsoluteUri);
            }
           string memberno = HttpContext.Current.User.Identity.Name;
            os = Teach.GetApTeach(memberno);
            switch (os)
            {
                case "-1": Response.End();
                    break;
                case "0": Page.Response.Redirect(LoginHost + "/" + (Page.Request.Url.AbsoluteUri.ToLower().IndexOf("invite_teach") >-1 ? "invite_teach" : "Teach") + "/Tpstep1.htm");
                    break;
                case "1": Page.Response.Redirect(LoginHost + "/" + (Page.Request.Url.AbsoluteUri.ToLower().IndexOf("invite_teach") >-1 ? "invite_teach" : "Teach") + "/Tpstep2.htm");
                    break;
                case "2": Page.Response.Redirect(LoginHost + "/" + (Page.Request.Url.AbsoluteUri.ToLower().IndexOf("invite_teach") >-1 ? "invite_teach" : "Teach") + "/Tpstep3.htm");
                    break;
                default: 
                    break;
            }
        }
    }
}
